from django.urls import re_path

from recruitment import views
from recruitment.views import RecruitSearchViewSet

urlpatterns = [
    re_path(r'^city/hotlist/$',views.HotCityAPIView.as_view()),
    re_path(r'^recruits/search/recommend/$',views.RecruitAPIView.as_view()),
    re_path(r'^recruits/search/latest/$',views.NewRecruitAPIView.as_view()),
    re_path(r'^enterprise/search/hotlist/$',views.EnterpriseAPIView.as_view()),
    re_path(r'^recruits/(?P<id>\d+)/$',views.RecruitsDetailsAPIView.as_view()),
    re_path(r'^recruits/(?P<pk>\d+)/visit/$',views.RecruitsVisitCountView.as_view()),
    re_path(r'^recruits/(?P<id>\d+)/collect/$',views.CollectRecruitView.as_view()),
    re_path(r'^recruits/(?P<id>\d+)/cancelcollect/$',views.CollectRecruitView.as_view()),
    re_path(r'^enterprise/(?P<id>\d+)/collect/$',views.CollectEnterprise.as_view()),
    re_path(r'^enterprise/(?P<id>\d+)/cancelcollect/$',views.CollectEnterprise.as_view()),
    re_path(r'^enterprise/(?P<id>\d+)/$',views.EnterpriseDetailsAPIView.as_view()),
    re_path(r'^enterprise/(?P<pk>\d+)/visit/$',views.EnterpriseVisitCountView.as_view()),
]

# 搜索职位
from rest_framework import routers

router = routers.DefaultRouter()

router.register(r'recruits/search/city/keyword',RecruitSearchViewSet, basename='recruits')

urlpatterns += router.urls

